import React from 'react'
import { ThemeConsumer, UserConsumer } from '../Context'

export default () => {
    return (
        <ThemeConsumer>
            {/* 传递是参数 */}
            {({ themeColor }) => (
                <div className={themeColor}>ConsumerPage
                    <UserConsumer>
                        {({ name }) => (
                            // userContext {name: 'UZI'}
                            // console.log(`name`, name)
                            <Clild name={name} />
                        )}
                    </UserConsumer>
                </div>
            )}
        </ThemeConsumer>
    )
}
const Clild = (props) => (
    <div className="border">{props.name}</div>
)